extends PlayerStatusBase

var still_time :float = 0
func start() ->void:
	actor.play_animation("attack1")
	still_time = 0
	
	SoundManager.play_sfx("attack")
	
# Called when the node enters the scene tree for the first time.
func run_physics_process(delta:float) -> void:
	actor.move_and_slide()
	
	still_time += delta
	if actor.is_play_animation("attack1"):
		return
		
	if actor.is_on_floor():
		if actor.can_attack(2):
			return change_status("Attack2")
		if actor.velocity.x == 0:
			return change_status("Idle")
		else:
			return change_status("Run")
	else:
		# 空中不会进入二阶段
		if actor.can_attack(1):
			start()
 
# Called every frame. 'delta' is the elapsed time since the previous frame.
func run_process(delta: float) -> void:
	if actor.is_on_floor():
		stand_velocity(delta)
	else:
		common_velocity(delta)

